home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIDOMParser.idl < prev    next >
Text File  |  2006-05-08  |  5KB  |  112 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #include "nsISupports.idl"
  39.  
  40. interface nsIInputStream;
  41. interface nsIDOMDocument;
  42. interface nsIURI;
  43.  
  44. /**
  45.  * The nsIDOMParser interface is a non-SAX interface that can be used
  46.  * to parse a string or byte stream containing XML or HTML content
  47.  * to a DOM document. Parsing is always synchronous - a document is always
  48.  * returned from the parsing methods. This is as opposed to loading and
  49.  * parsing with the XMLHttpRequest interface, which can be used for
  50.  * asynchronous (callback-based) loading.
  51.  */
  52.  
  53. [scriptable, uuid(4f45513e-55e5-411c-a844-e899057026c1)]
  54. interface nsIDOMParser : nsISupports {
  55.  
  56.   /**
  57.    * The string passed in is parsed into a DOM document.
  58.    *
  59.    * @param str The UTF16 string to be parsed
  60.    * @param contentType The content type of the string (see parseFromStream)
  61.    * @returns The DOM document created as a result of parsing the 
  62.    *          string
  63.    */
  64.   nsIDOMDocument parseFromString(in wstring str, in string contentType);
  65.  
  66.   /**
  67.    * The buffer is parsed into a DOM document.
  68.    * The charset is determined from the xml entity decl.
  69.    *
  70.    * @param buf The octet array data to be parsed
  71.    * @param bufLen Length (in bytes) of the data
  72.    * @param contentType The content type of the data (see parseFromStream)
  73.    * @returns The DOM document created as a result of parsing the 
  74.    *          string
  75.    */
  76.   nsIDOMDocument parseFromBuffer([const,array,size_is(bufLen)] in octet buf, in PRUint32 bufLen, in string contentType);
  77.  
  78.   /**
  79.    * The byte stream passed in is parsed into a DOM document.
  80.    *
  81.    * Not accessible from web content.
  82.    *
  83.    * @param stream The byte stream whose contents are parsed
  84.    * @param charset The character set that was used to encode the byte
  85.    *                stream. NULL if not specified.
  86.    * @param contentLength The number of bytes in the input stream.
  87.    * @param contentType The content type of the string - either text/xml,
  88.    *                    application/xml, or application/xhtml+xml.
  89.    *                    Must not be NULL.
  90.    * @returns The DOM document created as a result of parsing the 
  91.    *          stream
  92.    */
  93.   nsIDOMDocument parseFromStream(in nsIInputStream stream, 
  94.                                  in string charset,
  95.                                  in long contentLength,
  96.                                  in string contentType);
  97.  
  98.   /**
  99.    * Set/Get the baseURI, may be needed when called from native code.
  100.    */
  101.   [noscript] attribute nsIURI baseURI;
  102. };
  103.  
  104. %{ C++
  105. #define NS_DOMPARSER_CID                            \
  106.  { /* 3a8a3a50-512c-11d4-9a54-000064657374 */       \
  107.    0x3a8a3a50, 0x512c, 0x11d4,                      \
  108.   {0x9a, 0x54, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74} }
  109. #define NS_DOMPARSER_CONTRACTID \
  110. "@mozilla.org/xmlextras/domparser;1"
  111. %}
  112.